from Signature import *

class BLS(Signature):
    def __init__(self):
        super().__init__()

    def key_gen(self):
        x = self.group.random(ZR)
        return {'sk': x, 'pk': x * self.g}

    def signature(self, m, sk):
        return sk * self.from_hash(m)

    def verify(self, m, sig, pk):
        return e(self.g, sig) == e(pk, self.from_hash(m))

if __name__ == '__main__':
    bls = BLS()
    bls.test(b'hello')

